/**
 * Created by STICKYQU on 2016/7/7.
 */


$(document).ready(function() {
    init();
});


//初始页面
function init(){
    $.ajax({
        url: "/cgi/login.php",
        type: "post",
        dataType:"json",
        data: {
            "name": "",
            "password":  "",
            'code': "",
            'appkey' : ""
        },
        success: function(data) {
            //{code:0,skey:"skey",user:"" }
            if (data.code == 0) {
                $("#username").html(data.user.name);
            }
            else {
                location.href="/login.html";
            }
        },
        error:function(respone){
            if(console&& console.error)
                console.error(respone.responseText);
        }
    });
}

